package com.ibeetl.cms.util;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

/**
 * @author liujun
 * @create 2019-12-23 16:14
 * @desc 通用业务逻辑处理
 **/
public class BusinessCommon {

    /**
     ** 功能描述:过滤无待审核企业并根据待审核数量从大到小进行排序
     ** @author liujun
     ** @date 2019/12/23 16:13
     **/
    public static List<Map<String,Object>> sort(List<Map<String, Object>> list){
        if(null == list || list.size() == 0){
            return list;
        }
        Collections.sort(list, new Comparator<Map<String, Object>>() {
            @Override
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                Integer name2 = Integer.valueOf(o1.get("waitCheckNumber").toString()) ;//name1是从你list里面拿出来的一个
                Integer name1 = Integer.valueOf(o2.get("waitCheckNumber").toString()) ; //name1是从你list里面拿出来的第二个name
                return name1.compareTo(name2);
            }
        });
        return list;
    }
}
